<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table border="1" style="border-collapse: collapse; width: 90%;margin: 0 auto;text-align: center;">
        <caption>学生信息表</caption>
        <thead>
            <tr>
                <th>序号</th>
                <th>姓名</th>
                <th>学号</th>
                <th>班级</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr class="bg-blue">
                <td>01</td>
                <td>张三</td>
                <td>2301</td>
                <td>1班</td>
                <td>
                    <button onclick="deletestu(this)">删除</button>
                </td>
            </tr>
            <tr class="bg-blue">
                <td>02</td>
                <td>张三</td>
                <td>2301</td>
                <td>1班</td>
                <td>
                    <button onclick="deletestu(this)">删除</button>
                </td>
            </tr>
            <tr class="bg-blue">
                <td>03</td>
                <td>张三</td>
                <td>2301</td>
                <td>1班</td>
                <td>
                    <button onclick="deletestu(this)">删除</button>
                </td>
            </tr>
        </tbody>
    </table>
    <button onclick="getChlidren()">获取子标签</button>
    <button onclick="getBrother()">获取兄弟标签</button>
    <script>
        function deletestu(it){
            // console.log(it)
            // document.querySelector()
            it.parentElement.parentElement.remove()
            // console.log(it.parentElement.parentElement.remove())
        }
        function getChlidren(){
            let body=document.querySelector("body")
            // let body=document.querySelector("body").parentNode
            console.log(body.children)
            console.log(body.childElementCount)
            console.log(body.childNodes)
        }
        function getBrother(){
            let body=document.querySelector("body")
            console.log(body.previousElementSibling)
            console.log(body.previousSibling)
            console.log(body.nextElementSibling)
            console.log(body.previousElementSibling.nextElementSibling)
            
        }
    </script>
</body>
</html>